<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <!--
        /**
        * o------------------------------------------------------------------------------o
        * | This file is part of the RGraph package - you can learn more at:             |
        * |                                                                              |
        * |                          http://www.rgraph.net                               |
        * |                                                                              |
        * | This package is licensed under the RGraph license. For all kinds of business |
        * | purposes there is a small one-time licensing fee to pay and for non          |
        * | commercial  purposes it is free to use. You can read the full license here:  |
        * |                                                                              |
        * |                      http://www.rgraph.net/LICENSE.txt                       |
        * o------------------------------------------------------------------------------o
        */
    -->
    <title>RGraph: Javascript charts library - horizontal bar charts</title>
    
    <meta name="keywords" content="rgraph html5 canvas example horizontal bar charts" />
    <meta name="description" content="RGraph: Javascript charts library -  Horizontal Bar charts example" />
    
    <meta property="og:title" content="RGraph: Javascript charts library" />
    <meta property="og:description" content="A charts library based on the HTML5 canvas tag" />
    <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/>

    <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
    <link rel="icon" type="image/png" href="../images/favicon.png">
    
    <!-- Place this tag in your head or just before your close body tag -->
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.tooltips.js" ></script>
    <script src="../libraries/RGraph.common.effects.js" ></script>
    <script src="../libraries/RGraph.hbar.js" ></script>
    <!--[if IE 8]><script src="../excanvas/excanvas.original.js"></script><![endif]-->

    <script>
        /**
        * The onload function creates the chart
        */
        window.onload = function ()
        {

            var hbar1 = new RGraph.HBar('hbar1', [55.11, 21.63, 11.94, 7.15, 2.14, 1.11, 0.91]);

            var grad = hbar1.context.createLinearGradient(275,0,900, 0);
            grad.addColorStop(0, 'white');
            grad.addColorStop(1, 'blue');

            hbar1.Set('chart.strokestyle', 'rgba(0,0,0,0)');
            hbar1.Set('chart.gutter.left', 275);
            hbar1.Set('chart.gutter.right', 10);
            hbar1.Set('chart.background.grid.autofit', true);
            hbar1.Set('chart.title', 'Browser usage (NetApps) in May 2011');
            hbar1.Set('chart.labels', ['Microsoft Internet Explorer (55.11%)','Mozilla Firefox (21.63%)', 'Google Chrome (11.94)','Apple Safari (7.15%)','Opera (2.14%)','Opera Mini (1.11)','Other (0.91%)']);
            hbar1.Set('chart.shadow', true);
            hbar1.Set('chart.shadow.color', 'gray');
            hbar1.Set('chart.shadow.offsetx', 0);
            hbar1.Set('chart.shadow.offsety', 0);
            hbar1.Set('chart.shadow.blur', 15);
            hbar1.Set('chart.colors', [grad]);
            
            if (RGraph.isIE8()) {
                hbar1.Draw();
            } else {
                RGraph.Effects.HBar.Grow(hbar1);
            }
        }
    </script>
  
</head>
<body>

    <h1>RGraph: <span>Javascript charts library</span> - Horizontal bar charts</h1>

    <script>
        if (RGraph.isIE8()) {
            document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer 8 does not natively support the HTML5 canvas tag, so if you want to see the charts, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag.</div>');
        }
    </script>
    
    <p>
        A horizontal bar chart can be useful when your labels are too big for regular bar charts.
    </p>
    
    <ul>
        <li><a href="../docs/hbar.html">The API documentation</a></li>
    </ul>

    <a name="gutter-example"></a>
    <canvas id="hbar1" width="900" height="400">[No canvas support]</canvas>

</body>
</html>